package com.bilgeadam.hibernate.model.bll;

import com.bilgeadam.hibernate.model.dal.EmployeeDal;
import com.bilgeadam.hibernate.model.entity.Employee;

/**
 * 
 * @author Bora SAYINER
 * @since Nov 21, 2014 4:06:33 PM
 * @version 1.0.0
 */
public class Employees extends AbstractBll<Long, Employee> {

	public Employees() {
		super(new EmployeeDal());
	}

	@Override
	public boolean validateEntity(Employee entity) {
		boolean result = true;
		if (entity.getFirstName() == null || entity.getFirstName().trim().length() < 3) result = false;
		if (entity.getLastName() == null || entity.getLastName().trim().length() < 2) result = false;
		return result;
	}

}
